package model;

import java.io.File;
import java.util.ArrayList;

public class FitsFileList {
	
	ArrayList<FitsFile> listOfFF = new ArrayList<FitsFile>();
	
	public void makeListFromFolder(String folder, String survey){
		
		File folderOfFiles = new File(folder);
		String[] fitsArray=null;
		if(folderOfFiles.isDirectory()){
			fitsArray = folderOfFiles.list();
		}
		for(int i=0;i<fitsArray.length;i++){
			String filename = fitsArray[i];
			FitsFile ff = new FitsFile(folder+filename);
				ff.extractMetadata(survey);
				this.listOfFF.add(ff);
		}
		// the object now has a list of FitsFile objects in its ArrayList
	}
	
	public void addFitsFile(FitsFile ff){
		this.listOfFF.add(ff);
	}
	
	public ArrayList<FitsFile> getListOfFF() {
		return listOfFF;
	}

	public void setListOfFF(ArrayList<FitsFile> listOfFF) {
		this.listOfFF = listOfFF;
	}

}
